Structural Diversity: the Matlab script Structural_Diversity.m generates ego-level tables associated with the complex contagion and structural diversity analysis as described in S2.7 and S3.5.2 subsections in Supplementary Materials.

In detail for each ego we extract the number of peers that are active in each day but also the number of active connected components (i.e. the connected components in the ego's neighborhood where at least one individual is active).



input data files: 	run_mat.mat
	     		distance_mat.mat
	    	        duration_mat.mat
	     		pace_mat.mat
			TimeZone_mat.mat
			StartTime_mat.mat 
	     		PRECIPITATION_mat.mat
             		TMAX_mat.mat
	     		USERREL_USEDFOR_SOCIAL_INFLUENCE_wth_correlations.mat
	     		App_Users_in_Graph_demographics.csv


output data file:       structural_diversity_data.txt (headers only-redacted for legal reasons)



Embeddedness: the Matlab script MatlabScript_Embeddedness.m runs the code and generate the data tables needed for the embeddedness analysis as described in S2.7 and S3.5.3 subsections in Supplementary Materials.

In detail for each ego we isolate the peers that share with the ego a common friend and calculate the average running activity of this sub-neighborhood. We do the same for the non embedded neighborhood (separately).

input data files: 	run_mat.mat
	     		distance_mat.mat
	    	        duration_mat.mat
	     		pace_mat.mat
			TimeZone_mat.mat
			StartTime_mat.mat 
	     		PRECIPITATION_mat
             		TMAX_mat.mat
	     		USERREL_USEDFOR_SOCIAL_INFLUENCE_wth_correlations.mat
	     		App_Users_in_Graph_demographics.csv

output data files: 	embedded_data.txt (only headers-redacted for legal reasons)




the STATA script structdiversity_embeddedness.do replicates the results presented in tables S13, S15, S16 and S17 in supplementary materials (Figure 4 of the main manuscript).

input data files: embedded_data.txt (only headers-redacted for legal reasons)
		  structural_diversity_data.txt (only headers-redacted for legal reasons)


